package com.javasm.service.MisMannageService.impl;


import com.javasm.dao.MisMannageDao.AuditDao;
import com.javasm.dao.MisMannageDao.impl.AuditDaoImpl;
import com.javasm.entity.MisMannageEntity.ProdInfo;
import com.javasm.entity.MisMannageEntity.UserInfo;
import com.javasm.service.MisMannageService.AuditService;

import java.util.List;

public class AuditServiceImpl implements AuditService {

    @Override
    public UserInfo getname(Integer userId) {
        AuditDao auditDao = new AuditDaoImpl();
        UserInfo userInfo = auditDao.getname(userId);
        return userInfo;
    }

    @Override
    public Integer editStatus(String prodName, String auditStatus) {

        AuditDao auditDao = new AuditDaoImpl();
        Integer integer = auditDao.editStatus(prodName, auditStatus);
        return integer;
    }

    @Override
    public ProdInfo getProdByName(String prodName) {
        AuditDao auditDao = new AuditDaoImpl();
        ProdInfo editprod = auditDao.getProdByName(prodName);

        return editprod;
    }

    @Override
    public List<ProdInfo> getProd(Integer page, Integer pageSize, String prodName, String auditsStatus, Integer id) {
        AuditDao auditDao = new AuditDaoImpl();
        List<ProdInfo> showById = auditDao.getProd(page, pageSize, prodName, auditsStatus, id);
        return showById;
    }

    @Override
    public Integer getTotalnum(String prodName, String auditsStatus, Integer id) {
        AuditDao auditDao = new AuditDaoImpl();
        Integer totalnum = auditDao.getTotalnum(prodName, auditsStatus, id);
        return totalnum;
    }


}
